﻿/*
* Copyright (c) 2010-2012 Tesla Engine Group
* 
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* 
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* 
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

using System;

namespace Tesla.Graphics {
    /// <summary>
    /// Represents a display subsystem.
    /// </summary>
    public interface IGraphicsAdapter {

        /// <summary>
        /// Gets the collection of supported display modes.
        /// </summary>
        DisplayModeCollection SupportedDisplayModes {
            get;
        }

        /// <summary>
        /// Gets the description of the device.
        /// </summary>
        String Description {
            get;
        }

        /// <summary>
        /// Gets the device ID which identifies the particular chipset.
        /// </summary>
        int DeviceId {
            get;
        }

        /// <summary>
        /// Gets the adapter's revision number for the particular chipset its associated with.
        /// </summary>
        int Revision {
            get;
        }

        /// <summary>
        /// Gets the value that identifies the adapter's subsystem.
        /// </summary>
        int SubSystemId {
            get;
        }

        /// <summary>
        /// Gets the value that identifies that chipset's manufacturer.
        /// </summary>
        int VendorId {
            get;
        }

        /// <summary>
        /// Gets if this is the default adapter, always the first adapter.
        /// </summary>
        bool IsDefaultAdapter {
            get;
        }

        /// <summary>
        /// Gets the maximum size of a Texture1D resource.
        /// </summary>
        int MaximumTexture1DSize {
            get;
        }

        /// <summary>
        /// Gets the maximum size (U,V) of a Texture2D resource.
        /// </summary>
        int MaximumTexture2DSize {
            get;
        }

        /// <summary>
        /// Gets the maximum size (U,V,W) of a Texture3D resource.
        /// </summary>
        int MaximumTexture3DSize {
            get;
        }

        /// <summary>
        /// Gets the maximum size of a TextureCube resource.
        /// </summary>
        int MaximumTextureCubeSize {
            get;
        }

        /// <summary>
        /// Gets the maximum number of render targets that can be set to the
        /// device at once (MRT).
        /// </summary>
        int MaximumMultiRenderTargets {
            get;
        }

        /// <summary>
        /// Gets the maximum number of vertex buffers that can be set to the device at once.
        /// </summary>
        int MaximumVertexStreams {
            get;
        }

        /// <summary>
        /// Gets the maximum number of sampler states.
        /// </summary>
        int MaximumSamplerStates {
            get;
        }

        /// <summary>
        /// Gets the maximum number of vertex sampler states.
        /// </summary>
        int MaximumVertexSamplerStates {
            get;
        }

        /// <summary>
        /// Queries if the specified surface format is valid for texture resources.
        /// </summary>
        /// <param name="surfaceFormat">Surface format</param>
        /// <param name="texType">Type of texture</param>
        /// <returns>True if valid, false otherwise</returns>
        bool QueryTextureFormat(SurfaceFormat surfaceFormat, TextureDimensions texType);

        /// <summary>
        /// Queries if the specified surface format is valid for vertex texture resources.
        /// </summary>
        /// <param name="surfaceFormat">Surface format</param>
        /// <param name="texType">Type of texture</param>
        /// <returns>True if valid, false otherwise</returns>
        bool QueryVertexTextureFormat(SurfaceFormat surfaceFormat, TextureDimensions texType);

        /// <summary>
        /// Queries if the specified formats and sample counts are valid for the backbuffer.
        /// </summary>
        /// <param name="format">Surface format</param>
        /// <param name="depthFormat">Depth format</param>
        /// <param name="multiSampleCount">Sample count</param>
        /// <returns>True if a valid combination</returns>
        bool QueryBackBufferFormat(SurfaceFormat format, DepthFormat depthFormat, int multiSampleCount);

        /// <summary>
        /// Queries if the specified format and sample counts are valid for a render target.
        /// </summary>
        /// <param name="format">Surface format</param>
        /// <param name="depthFormat">Depth format</param>
        /// <param name="multiSampleCount">Sample count</param>
        /// <returns>True if a valid combination</returns>
        bool QueryRenderTargetFormat(SurfaceFormat format, DepthFormat depthFormat, int multiSampleCount);

        /// <summary>
        /// Queries for the number of multisample quality levels are supported for the sample count.
        /// </summary>
        /// <param name="format">Specified format</param>
        /// <param name="multiSamplecount">Sample count</param>
        /// <returns>Number of supported quality levels</returns>
        int QueryMultiSampleQualityLevels(SurfaceFormat format, int multiSamplecount);
    }
}
